package com.chinairi.mall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinairi.mall.model.ProjectPlanPickingDetail;
import com.chinairi.mall.service.modelobject.MatServiceInfoMO;
import com.chinairi.mall.service.modelobject.ProjectPlanPickingDetailMO;
import com.chinairi.mall.service.modelobject.StorageFlatMO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 需求建议计划表 Mapper 接口
 * </p>
 *
 * @author Webgasd
 * @since 2020-10-15
 */
public interface ProjectPlanPickingDetailMapper extends BaseMapper<ProjectPlanPickingDetail> {
    /**
     * 根据条件筛选列表
     *
     * @param planMatCodeList
     * @param planReqId
     * @param saDbid
     * @return
     */
    List<ProjectPlanPickingDetailMO> selectListByList(@Param("planMatCodeList") List<String> planMatCodeList, @Param("planReqId") String planReqId, @Param("saDbid") String saDbid);

    /**
     * 批量插入
     * @param projectPlanPickingDetailMOList
     */
    void batchInsertDetail(@Param("projectPlanPickingDetailMOList") List<ProjectPlanPickingDetailMO> projectPlanPickingDetailMOList);

    /**
     * 获取list
     * @param pickingId
     * @return
     */
    List<StorageFlatMO> selectPickAndStorage(@Param("pickingId") String pickingId);

    /**
     * 根据条件获取物料在服务中的信息
     * @param matDbIdList
     * @param serviceClass
     * @param flag
     * @param csDbid
     * @return
     */
    List<MatServiceInfoMO> selectMatServiceInfo(@Param("matDbIdList") List<String> matDbIdList,
                                                @Param("serviceClass") String serviceClass,
                                                @Param("flag") Integer flag,
                                                @Param("csDbid") String csDbid);

    /**
     * 根据领料单主键查找详细列表的
     * @param ostId
     * @return
     */
    List<String> selectDetailIdList(@Param("ostId") String ostId);

    /**
     * 根据主键列表找detail列表
     * @param detailIdList
     * @return
     */
    List<ProjectPlanPickingDetail> getListByDetailList(@Param("detailIdList") List<String> detailIdList);

    /**
     * 批量更新状态
     * @param projectPlanPickingDetailList
     */
    void batchUpdateState(@Param("projectPlanPickingDetailList") List<ProjectPlanPickingDetail> projectPlanPickingDetailList);

    /**
     * 根据领料单id查询领料详情
     * @param pickId 领料单id
     * @return 领料单详情列表
     */
    List<ProjectPlanPickingDetail> getListByPickId(String pickId);
}
